//
//  EditViewController.m
//  6-13
//
//  Created by mac on 16-6-14.
//  Copyright (c) 2016年 hf. All rights reserved.
//

#import "EditViewController.h"

@interface EditViewController ()
{
    UITextField *to;
}
@end

@implementation EditViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)viewWillDisappear:(BOOL)animated
{
    if (self.delegate)
    {
        [self.delegate inpuString:to.text];
    }
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *ce = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
    if (!to)
    {
        to = [[UITextField alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 44)];
    }
    [ce.contentView addSubview:to];
    return ce;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
